﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FriendAD.Core
{
    /// <summary>
    /// 管理员模型
    /// </summary>
  public  class Admin
    {
        [Key]
        public int AdminId { set; get; }

        /// <summary>
        /// 用户名
        /// </summary>
        [Required(ErrorMessage ="请输入{0}")]
        [StringLength(30,MinimumLength =4,ErrorMessage ="{0}长度为{2}-{1}个字符")]
        [Display(Name ="用户名")]
        public string Account { set; get; }
        /// <summary>
        /// 密码
        /// </summary>
        [DataType(DataType.Password)]
        [Required(ErrorMessage ="请输入{0}")]
        [StringLength(256,ErrorMessage ="{0}长度少于{1}个字符")]
        [Display(Name ="密码")]
        public string Password { set; get; }

        /// <summary>
        /// 登陆ip
        /// </summary>
        [Display(Name ="登陆ip")]
        public string LoginIP { set; get; }
        /// <summary>
        /// 登录时间
        /// </summary>
        [Display(Name = "登录时间")]
        public Nullable<DateTime> LoginTime { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreateTime { get; set; }
    }
}
